import Vue from 'vue'
import { USER_INFO } from "@/store/mutation-types"

//获取用户当前所属的部门
export function orgCodeWhere(orgCode) {
  // let user = Vue.ls.get(USER_INFO);
  // let userOrgCode  = user.orgCode;
  let orderBy = " order by orgCode asc";
  return "orgCode like '"+orgCode+"%'"+orderBy;
  // if('3'!==user.type && (!orgCode || userOrgCode.length >= orgCode.length)){
  //   return "orgCode like '"+userOrgCode+"%'"+orderBy;
  // }
  // if(userOrgCode.length < orgCode.length){
  //   return "orgCode like '"+orgCode+"%'"+orderBy;
  // }
  // return "orgCode like '"+orgCode+"%'"+orderBy;
}

//获取用户当前所属的部门
export function userOrgCode() {
  let user = Vue.ls.get(USER_INFO)
  return user.orgCode;

}
